package day10;

import java.util.Locale;

public class StringDemo {
    public static void m1() {
    }

    public static void m2() {
        String str = new String();//创建了空字符序列-----》""  补课变得
        str = "abc";//左边复制
        String str2 = new String("bcd");
        char[] chars = {'a', 'b', 'c', 'd'};
        String str3 = new String(chars);
        System.out.println(str3);
        byte[] bytes = {97, 98, 99};
        String str4 = new String(bytes);
        System.out.println(str4);
        String str5="a-b-c-d-e-f-g-h-i-l";
        String str6=str5.substring(5,9);
        System.out.println(str6);
        char[] chars1=str5.toCharArray();
        for(char ch:chars1)
            System.out.print(ch+",");
        System.out.println("-------------");
        //分割字符串 split(String str) String regex 正则表达式
        String[] strings=str5.split("-");
        for(String str8:strings)
            System.out.print(str8+",");
        String str9=str3.toUpperCase();
        System.out.println(str9);
    }

    public static void main(String[] args) {
        StringDemo s = new StringDemo();
        s.m2();

    }
}
